package com.Endurancer.manager.service.impl;

import java.util.List;
import com.Endurancer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.Endurancer.manager.mapper.FamousQuotesMapper;
import com.Endurancer.manager.domain.FamousQuotes;
import com.Endurancer.manager.service.IFamousQuotesService;

/**
 * 名言Service业务层处理
 * 
 * @author Endurancer
 * @date 2025-02-02
 */
@Service
public class FamousQuotesServiceImpl implements IFamousQuotesService 
{
    @Autowired
    private FamousQuotesMapper famousQuotesMapper;

    /**
     * 查询名言
     * 
     * @param quoteId 名言主键
     * @return 名言
     */
    @Override
    public FamousQuotes selectFamousQuotesByQuoteId(Long quoteId)
    {
        return famousQuotesMapper.selectFamousQuotesByQuoteId(quoteId);
    }

    /**
     * 查询名言列表
     * 
     * @param famousQuotes 名言
     * @return 名言
     */
    @Override
    public List<FamousQuotes> selectFamousQuotesList(FamousQuotes famousQuotes)
    {
        return famousQuotesMapper.selectFamousQuotesList(famousQuotes);
    }

    /**
     * 新增名言
     * 
     * @param famousQuotes 名言
     * @return 结果
     */
    @Override
    public int insertFamousQuotes(FamousQuotes famousQuotes)
    {
        famousQuotes.setCreateTime(DateUtils.getNowDate());
        return famousQuotesMapper.insertFamousQuotes(famousQuotes);
    }

    /**
     * 修改名言
     * 
     * @param famousQuotes 名言
     * @return 结果
     */
    @Override
    public int updateFamousQuotes(FamousQuotes famousQuotes)
    {
        famousQuotes.setUpdateTime(DateUtils.getNowDate());
        return famousQuotesMapper.updateFamousQuotes(famousQuotes);
    }

    /**
     * 批量删除名言
     * 
     * @param quoteIds 需要删除的名言主键
     * @return 结果
     */
    @Override
    public int deleteFamousQuotesByQuoteIds(Long[] quoteIds)
    {
        return famousQuotesMapper.deleteFamousQuotesByQuoteIds(quoteIds);
    }

    /**
     * 删除名言信息
     * 
     * @param quoteId 名言主键
     * @return 结果
     */
    @Override
    public int deleteFamousQuotesByQuoteId(Long quoteId)
    {
        return famousQuotesMapper.deleteFamousQuotesByQuoteId(quoteId);
    }
}
